class ChangeRatingsToRatingsAndComments < ActiveRecord::Migration
  def self.up
    remove_column :item_ratings, :item_title
    remove_column :item_ratings, :title
    remove_column :item_ratings, :content
    remove_column :item_ratings, :tags
    remove_column :item_ratings, :reply_count
    remove_column :item_ratings, :up_vote_count
    remove_column :item_ratings, :down_vote_count
    rename_column :item_ratings, :total_rating, :global_rating
  end

  def self.down
    add_column :item_ratings, :item_title, :string, :limit => 255
    add_column :item_ratings, :title, :string, :limit => 255
    add_column :item_ratings, :content, :text
    add_column :item_ratings, :tags, :string, :limit => 1000
    add_column :item_ratings, :reply_count, :integer, :default => 0
    add_column :item_ratings, :up_vote_count, :integer, :default => 0
    add_column :item_ratings, :down_vote_count, :integer, :default => 0
    rename_column :item_ratings, :global_rating, :total_rating
  end
end
